package com.jilujia.domain.user;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import com.jilujia.framework.domain.PoEntity;

/**
 * A user who can book hotels.
 */
@Entity
@Table(name = "TB_R_USER_ANSWER")
public class UserVoteAnswer implements PoEntity<Long>, Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = -3652559447682574722L;

	private Long id;

	@NotNull
	private Long userId;

	@NotNull
	private Long answerId;

	private boolean useful = true;

	public UserVoteAnswer() {
	}

	public UserVoteAnswer(Long userId, Long answerId, boolean useful) {
		this.setUserId(userId);
		this.setAnswerId(answerId);
		this.setUseful(useful);
	}

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public Long getAnswerId() {
		return answerId;
	}

	public void setAnswerId(Long answerId) {
		this.answerId = answerId;
	}

	public boolean getUseful() {
		return useful;
	}

	public void setUseful(boolean useful) {
		this.useful = useful;
	}

}
